package com.infore.remoteControl.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.infore.remoteControl.entity.protocolEntity.ProtocolData;

@Repository
public interface IProtocolDataRepository extends JpaRepository<ProtocolData, String>, JpaSpecificationExecutor<ProtocolData> {
	
	/** 分页查询(发布日期排序) **/
	Page<ProtocolData> findByOrderByPublishedDateDesc(Pageable pageable);
	/** 按发布日期排序查询 **/
	List<ProtocolData> findByOrderByPublishedDateDesc();
	/** 根据协议数据ID查询协议 **/
	List<ProtocolData> findByIdIn(List<String> protocolDataIds);
	/** 批量删除 **/
	@Modifying
	@Transactional
	int deleteByIdIn(List<String> ids);
}
